import { reducer as addTodoReducer } from './addTodo'


const reducers = [
  addTodoReducer,
];

const initialState = {
  todos: [
    {
      id: 1,
      completed: false,
      text: 'learn redux - reducer/actions file architechture'
    }
  ]
};

export default function reducer(state = initialState, action) {
  let newState;
  switch (action.type) {
    // Handle cross-topic actions here
    default:
      newState = state;
      break;
  }
  return reducers.reduce((state, reducer) => reducer(state, action), newState);
}